package patrol.mobile.com.mobilepatrol.activity.security.emergency;

import android.support.v7.widget.SearchView;
import android.view.View;
import android.widget.Toast;

import com.dl7.recycler.adapter.BaseQuickAdapter;
import com.dl7.recycler.listener.OnRecyclerViewItemClickListener;

import java.util.ArrayList;
import java.util.List;

import patrol.mobile.com.mobilepatrol.activity.CommonListWithSearchActivity;
import patrol.mobile.com.mobilepatrol.activity.security.ConsTitles;
import patrol.mobile.com.mobilepatrol.activity.security.adapter.Emergency1ListAdapter;

/**
 * Created by fuzhen.li on 2018/9/18.
 */
public class Emergency1Activity extends CommonListWithSearchActivity {
    @Override
    protected BaseQuickAdapter initAdapter() {
        return new Emergency1ListAdapter(this);
    }

    @Override
    protected String initTitleName() {
        return ConsTitles.EMERGENCY_1;
    }

    @Override
    public void configAdapter() {
        super.configAdapter();
        mAdapter.setOnItemClickListener(new OnRecyclerViewItemClickListener() {
            @Override
            public void onItemClick(View view, int position) {
                startActivity(Emergency2Activity.class);
            }
        });

        List<String> list = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            list.add("123");
        }
        mAdapter.updateItems(list);
        searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
            @Override
            public boolean onQueryTextSubmit(String query) {
                Toast.makeText(Emergency1Activity.this, "123", Toast.LENGTH_SHORT).show();
                return false;
            }

            @Override
            public boolean onQueryTextChange(String newText) {
                return false;
            }
        });
    }
}
